<template>
  <component :is="componentName"></component>
</template>

<script>
import Empty from "./components/Empty.vue";
import NotIE from "./components/NotIE.vue";
import IE from "./components/IE.vue";

export default {
  name: "Main",
  components: {
    Empty,
    NotIE,
    IE,
  },
  data() {
    return {
      componentName: "Empty",
      bg: "none",
    };
  },
  computed: {},
  methods: {
    isIE() {
      // ie?
      // edge浏览器中为false，ie11及以下版本为true
      if (!!window.ActiveXObject || "ActiveXObject" in window) return true;
      else return false;
    },
  },
  created() {
    // 更新页面title
    document.title = '长泰智能设备';
  },
  mounted() {
    if (this.isIE()) {
      this.componentName = "IE";
    } else {
      this.componentName = "NotIE";
      this.bg = require("./assets/img/bg.png");
    }
  },
};
</script>
